<!--
描述：系统应用-用户管理-查看组件
开发人：hqj
开发日期：2017年12月11日
-->
<template lang="pug">
  kalix-dialog.user-add(bizKey="liveVideo" ref="kalixBizDialog" v-bind:formModel.sync="formModel" isView)
    div.el-form(slot="dialogFormSlot")
      el-form-item(label="课程名称" prop="name" v-bind:label-width="labelWidth")
        el-input(v-model="formModel.name" readonly="readonly")
      el-form-item(label="老师名称" prop="teacher" v-bind:label-width="labelWidth")
        el-input(v-model="formModel.teacher" readonly="readonly")
      el-form-item(label="课程简介" prop="classIntroduce" v-bind:label-width="labelWidth")
        el-input(v-model="formModel.classIntroduce" readonly="readonly")
      el-form-item.short(label="视频" prop="video" v-bind:label-width="labelWidth")
        vue-player(:src="video" v-show="video === null ? false : (video === ' ' ? false : true)" style="margin-bottom: 22px;")
</template>

<script type="text/ecmascript-6">
  import FormModel from './model'
  import VuePlayer from '../../../../../components/corelib/components/common/vue-player.vue'
  export default {
    name: 'liveVideoView',
    components: {VuePlayer},
    data() {
      return {
        formModel: Object.assign({}, FormModel),
        labelWidth: '140px',
        video: ''
      }
    },
    methods: {
      init(dialogOption) {
        console.log('---------dialogOption------------', dialogOption)
        if (this.formModel.video !== null && this.formModel.video !== '') {
          this.video = this.formModel.video
        }
      }
    }
  }
</script>
